
define([ "Zepto", "underscore", "Backbone", "Handlebars",
         "views/student/librettolistitemview",
         "views/common/menuview"], 
         function($, _, Backbone, Handlebars, 
        		 LibrettoListItemView, template, MenuView) {

	var LibrettoListView = Backbone.View.extend({

		template : Handlebars.compile(template),
		initialize : function() {
			this.model.bind("reset", this.render, this);
		},

		render : function(eventName) {
			
			

	
			_.each(this.model.models, function(item) {
			  $(this.el).append(new LibrettoListItemView({
			  		tagName : 'div',
			  		className : 'list-simple',
					model : item
				}).render().el);
			
			}, this);
		
			return this;
		},
  
	

		events : {
			'touchstart .list-item' : 'over',
			'touchend .list-item' : 'left',
			'touchcancel .list-item' : 'left', 
		},

		over : function(event) {
			$(event.currentTarget).addClass('fake-active');
		},

		left : function(event) {
			$(event.currentTarget).removeClass('fake-active');
		}
	});


	return LibrettoListView;


});

